package com.itheima.case2.dao;

import com.itheima.case2.pojo.po.UserLogin;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface UserLoginMapper {
    //登录功能（根据用户名和密码查询用户是否存在）
    @Select("select * from user where username=#{username} and password=#{password}")
    UserLogin login(UserLogin user);

    //根据用户名查询用户是否存在
    @Select("select*from user where username=#{username}")
    UserLogin queryUserByName(String username);

    //添加用户
    @Insert("insert into user values(null,#{username},#{password})")
    void insertUser(UserLogin user);
}
